<template>
	<view>
		<nav-back></nav-back>

		<view class="title">
			<text>您的月收入 </text>
		</view>
		<view class="tip">最真实的自己，更快遇到最应该的那个人</view>

		<picker-view  @change="changeIncome" :value="incomeValue" class="my-picker-view">
			<picker-view-column>
				<view class="item" v-for="(item,index) in incomeList" :key="index">{{item}}</view>
			</picker-view-column>
		</picker-view>

		<button class="next" type="primary" @click="handleNext">下一步</button>
	</view>
</template>

<script>
	import request from '@/utils/request.js'
	import NavBack from '@/components/NavBack.vue'

	export default {
		components: {
			NavBack
		},
		data() {
			return {
				incomeList: ['2000及以下', '2000-4000元', '4000-6000元', '6000-8000', '8000及以上'],
				income: '',
				incomeValue:[2]
			}
		},
		onLoad() {
			this.income = this.incomeList[2]
		},
		methods: {
			changeIncome(event) {
				let current = event.detail.value[0]
				console.log(current, 'changeHouse');
				this.incomeValue[0] = current
				this.income = this.incomeList[current]
			},
			handleNext() {
				getApp().globalData.userInfo.income = this.income
				console.log(this.income, 'this.income');
				uni.redirectTo({
					url: '/pages/userInfo/spouseDemand/spouseDemand'
				})
			},
		}
	}
</script>


<style lang="scss">
	@import "@/style/register.scss";
</style>